home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / Installer SDK 1.2.3 / Upgrader 1.2.3 & Engines / Upgrader 1.2.3 / Plug-in Examples / Common Files / MWCPlusExtensions / NMWException.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-07  |  2.3 KB  |  65 lines  |  [TEXT/CWIE]

  1. /************************************************************************/
  2. /*    Project...:    Standard C++ Library                                    */
  3. /*    Name......:    MWException.h                                            */
  4. /*    Purpose...:    portable exception handling                                */
  5. /*  Copyright.: ©Copyright 1993-95 by metrowerks inc                    */
  6. /************************************************************************/
  7.  
  8. #ifndef __MWEXCEPTIONS__
  9. #define __MWEXCEPTIONS__
  10.  
  11. ////    [this section needs to be copied from CException.h
  12.  
  13. typedef short    vbase_ctor_arg_type;
  14. typedef char    local_cond_type;
  15.  
  16. typedef struct CatchInfo {
  17.     void            *location;                //    pointer to complete exception object
  18.     void            *typeinfo;                //    pointer to complete exception object's typeinfo
  19.     void            *dtor;                    //    pointer to complete exception object's destructor function (0: no destructor)
  20.     void            *sublocation;            //    pointer to handlers subobject in complete exception object
  21.     long            pointercopy;            //    adjusted pointer copy for pointer matches (sublocation will point to the loaction)
  22.     void            *stacktop;                //    pointer to handlers stack top (reused for exception specification in specification handler)
  23. }    CatchInfo;
  24.  
  25. ////    [this section needs to be copied from CException.h]
  26.  
  27. typedef struct DestructorChain {            //    global destructor chain
  28.     struct DestructorChain    *next;            //    pointer to next destructor chain element
  29.     void                    *destructor;    //    pointer to destructor function
  30.     void                    *object;        //    pointer to memory location (0L: element is marker)
  31. }    DestructorChain;
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if __CFM68K__
  38. #pragma import on
  39. #endif
  40.  
  41. extern DestructorChain    *__global_destructor_chain;
  42. extern void                *__register_global_object(void *object,void *destructor,void *regmem);
  43. extern void                __destroy_global_chain(void);
  44.  
  45. extern void                __init__catch(CatchInfo* catchinfo);
  46. extern void                __end__catch(CatchInfo* catchinfo);
  47. extern void                __throw(char *throwtype,void *location,void *dtor);
  48. extern char                __throw_catch_compare(const char *throwtype,const char *catchtype,long *offset_result);
  49. extern void                __unexpected(CatchInfo* catchinfo);
  50.  
  51. #ifdef __POWERPC__
  52. extern int                __register_fragment(char *code_start,char *code_end,char *data_start,char *data_end,
  53.                                             char *exception_start,char *exception_end,char *TOC);
  54. extern void                __unregister_fragment(int fragmentID);
  55. #endif
  56.  
  57. #if __CFM68K__
  58. #pragma import reset
  59. #endif
  60.  
  61. #ifdef __cplusplus
  62. }
  63. #endif
  64. #endif
  65.